<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>支付页面</title>

    <link rel="stylesheet" type="text/css" href="../vendor/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="../fonts/font-awesome-4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="../fonts/iconic/css/material-design-iconic-font.min.css">
    <link rel="stylesheet" type="text/css" href="../css/util.css">
    <link rel="stylesheet" type="text/css" href="../css/main.css">
</head>

<body>

<div class="limiter">
    <div class="container-login100">
        <div class="wrap-login100 p-l-55 p-r-55 p-t-65 p-b-54">
            <form  action="/api/aliPay/toPayAsPC" method="post" class="login100-form validate-form">
                <div class="wrap-input100 validate-input m-b-23">
                    <span class="label-input100">商品名称</span>
                    <input class="input100" type="text" name="subject" id="subject">
                    <span class="focus-input100" data-symbol="&#xf206;"></span>
                </div>

                <div class="wrap-input100 validate-input">
                    <span class="label-input100">商品价格</span>
                    <input class="input100" type="text" name="totalAmount" id="totalAmount">
                    <span class="focus-input100" data-symbol="&#xf190;"></span>
                </div>
                <div class="wrap-input100 validate-input">
                    <span class="label-input100">商品描述</span>
                    <input class="input100" type="text" name="body" id="body">
                    <span class="focus-input100" data-symbol="&#xf190;"></span>
                </div>


                <div class="container-login100-form-btn">
                    <div class="wrap-login100-form-btn">
                        <button class="login100-form-btn" onclick="goPay1()">去支付</button>
                    </div>
                </div>

            </form>
        </div>
    </div>
</div>


<script type="text/javascript">

    function goPay() {
        var subject = $("#subject").val();
        var totalAmount = $("#totalAmount").val();
        var body = $("#body").val();
        $.ajax({
            dataType: "json",
            type: "POST",
            url: '/api/aliPay/toPayAsPC',
            data: {"subject": subject, "totalAmount": totalAmount, "body": body},
            success: function (data) {
                if (data.code != "200") {
                    alert("操作结果:" + data);
                } else {
                    alert("操作成功");
                }
                ;
            },

            error: function (err) {
                console.log(err);
                alert("失败!");
            }
        });
    }

</script>
</body>
</html>